<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>美研社前台登录</title>
<link rel="stylesheet" type="text/css" href="/bsc/static/css/style.css" />
<link rel="stylesheet" type="text/css" href="/bsc/static/css/body.css"/> 
<script type="text/javascript" src="/bsc/static/js/jquery.min.js"></script>
</head>
<body>
<div class="container" id="log">
	<section id="content">
		<form action="/bsc/user/login" id="f" method="post">
			<h1>员工登录</h1>
			<div>
				<input type="text" name="account" placeholder="账号" required="" id="username" />
				<input hidden type="text" name="stat" value="1" />
			</div>
			<div>
				<input type="password" name="password" placeholder="密码" required="" id="password" />
			</div>
			 <div class="">
				<span class="help-block u-errormessage" id="js-server-helpinfo">&nbsp;</span>			</div> 
			<div>
				<input type="submit" value="登录" onclick="sub()" class="btn btn-primary" id="js-btn-login"/>
				<a href="#" onclick="resetpwd()">忘记密码？</a>
			</div>
		</form><!-- form -->
	</section><!-- content -->
</div>
<!-- 重置密码 -->
<div id="up" class="container" style="display: none;">
	<section id="content">
	    <form action="" id="for"  method="post">
			<h1>填写以下信息重置密码为（123）</h1>
			<div>
				<input type="text" name="name" placeholder="账号" required="" id="username" />
				<input hidden type="text" name="stat" value="1" />
			</div>
			<div>
				<input type="text" name="idno" placeholder="身份证号" required="" id="password" />
			</div>
			 <div class="">
				<span class="help-block u-errormessage" id="js-server-helpinfo">&nbsp;</span>			</div> 
			<div>
				<input type="submit" onclick="subpwd()" value="提交" onclick="sub()" class="btn btn-primary" id="js-btn-login"/>
				<a href="#" onclick="returnlog()">点击返回</a>
			</div>
		</form>
	</section>
</div>
<br><br><br><br>
<div style="text-align:center;">
</div>
<script type="text/javascript">
/*  显示和隐藏  */
function resetpwd(){
	  $("#log").attr("style","display: none;");
	  $("#up").attr("style","");
}
function returnlog(){
	  $("#up").attr("style","display: none;");
	  $("#log").attr("style","");
}
/* 重置密码  */
function subpwd(){
	  $.ajax({
			type:"post",
			url:"/bsc/user/resetpwd",
			data:$("#for").serialize(),
			success:function(msg){
				alert(msg);
				if(msg=='y'){
					alert("重置成功！");
					returnlog();
				}else{
					alert("验证失败");
				}
			}
		});
}

	var error=${error};
	if(error=='2'){
		alert("账号或密码错误");
	}

</script>

</body>
</html>